<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Document</title>
    <style></style>
  </head>
  <body>
    <div>参数的默认值</div>
    <script>
      function foo(enable = true) {
        console.log(enable);
      }

      foo(); //不传参数取默认值
      foo(false); //传递参数,取传递的值
    </script>
  </body>
</html>
